package com.fulihui.usercore.api;

import com.fulihui.usercore.dto.WechatUserDTO;
import com.fulihui.usercore.request.user.UserIdRequest;
import com.fulihui.usercore.request.user.UserLoginIdWechatRequest;
import com.fulihui.usercore.request.user.UserWechatSingleRequest;
import com.fulihui.usercore.request.wechat.BindingWechatRequest;
import com.fulihui.usercore.request.wechat.UserWechatQueryByTypeRequest;
import com.fulihui.usercore.request.wechat.UserWechatQueryRequest;

import org.near.servicesupport.result.BaseResult;
import org.near.servicesupport.result.TMultiResult;
import org.near.servicesupport.result.TSingleResult;

/**
 * @author Willard.Hu on 2016/12/15 0015.
 */
public interface UserWechatService {

    /**
     * （分表分库）已改
     * <p>通过用户标识获取指定用户微信信息</p>
     * <p>多种组合方式查询：</p>
     * <li>userid + appid</li>
     * <li>openid + appid</li>
     * <li>unionid + appid</li>
     *
     * @param request {@link UserWechatSingleRequest}
     * @return 返回单个微信用户信息 {@link WechatUserDTO}
     */
    TSingleResult<WechatUserDTO> querySingle(UserWechatQueryRequest request);

    /**
     * （分表分库）已改
     * 绑定微信信息
     *
     * @param request {@link BindingWechatRequest}
     * @return 服务处理结果
     */
     BaseResult bindingWechat(BindingWechatRequest request);

    /**
     * （分表分库）已改
     * 获取用户已绑定的微信信息
     *
     * @param request {@link UserIdRequest}
     * @return {@link WechatUserDTO} 列表
     */
    TMultiResult<WechatUserDTO> userBounds(UserIdRequest request);

    /**
     * （分表分库）已改
     * 检测 资讯用户是否绑定 微信
     * @param request
     * @return 已绑定返回true
     */
    TSingleResult<Boolean> isBindingNativeApp(UserLoginIdWechatRequest request);


    /**
     * （分表分库）已改
     * 耳朵提现查询openid
     * @param request
     * @return
     */
    TSingleResult<WechatUserDTO> queryOpenId(UserWechatQueryRequest request);

    /**
     * （分表分库）已改
     * 根据openid和openidtype，查询一条授权信息
     * @param request
     * @return
     */
    TSingleResult<WechatUserDTO> querySingleByOpenIdAndType(UserWechatQueryByTypeRequest request);
}
